package com.axin.blog.api;


import com.axin.blog.api.domain.Blog;
import com.axin.blog.api.vo.BlogVo;
import com.axin.common.core.constant.ServiceNameConstants;
import com.axin.common.core.domain.web.AjaxResult;
import com.axin.common.core.domain.web.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * 博客服务 远程调用
 *
 * @Author axin
 * @Date 2021/10/31 23:15
 */
@FeignClient(contextId = "remoteBlogService", value = ServiceNameConstants.BLOG_SERVICE, path = "/blog")
public interface RemoteBlogService {

    /**
     * 查询博客列表
     *
     * @param pageNum
     * @param pageSize
     * @param createMonth
     * @param categoryId
     * @param tagId
     * @return
     */
    @GetMapping("/getNewBlogPageList")
    TableDataInfo getNewBlogPageList(@RequestParam("pageNum") Integer pageNum,
                                     @RequestParam("pageSize") Integer pageSize,
                                     @RequestParam(name = "createMonth", required = false, defaultValue = "") String createMonth,
                                     @RequestParam(name = "categoryId", required = false, defaultValue = "") Long categoryId,
                                     @RequestParam(name = "tagId", required = false, defaultValue = "") Long tagId);


    /**
     * 根据ID获取博客详情
     *
     * @param blogId
     * @return
     */
    @GetMapping("/getBlogDetail/{blogId}")
    AjaxResult<BlogVo> getBlogDetail(@PathVariable("blogId") Long blogId);


    /**
     * 获取时间归档
     *
     * @return
     */
    @GetMapping("/getMonthArchiveList")
    AjaxResult getMonthArchiveList();


}
